<?php
/**
 * Created by 荣耀电竞.
 * User: 林子彦 <278805354@qq.com>
 * Date: 2018/6/12 0012
 * Time: 10:04
 */
Route::group(['prefix'=>'admin'], function() {
    //权限
    Route::group(['middleware' => 'permission'], function () {
        //=======================================================产品操作===============================================================
        Route::get('/shop/goods/index', ['uses' => 'AdminGoodsController@index']);  //后台管理首页
        Route::get('/shop/goods/add', ['uses' => 'AdminGoodsController@add']);  //后台产品添加
        Route::get('/shop/goods/demo', ['uses' => 'AdminGoodsController@imgTlpDemo']);  //后台产品添加
        Route::get('/shop/goods/edit/{goods_id}', ['uses' => 'AdminGoodsController@edit'])->where('goods_id', '[0-9]+');  //后台产品编辑
        //======================================================产品分类操作===============================================================
        Route::get('/shop/goods/class/index', ['uses' => 'AdminGoodsClassController@index']);  //获取产品分类
        Route::get('/shop/goods/class/show_select_menus', ['uses' => 'AdminGoodsClassController@classSelectMenus']);   //选择分类
    });
    Route::group(['middleware' => ['permission','response','transaction']], function () {
        Route::post('/shop/goods/add', ['uses' => 'AdminGoodsController@add']);  //后台产品添加
        Route::post('/shop/goods/edit', ['uses' => 'AdminGoodsController@edit']);  //后台产品添加
        Route::post('/shop/goods/index', ['uses' => 'AdminGoodsController@index']);  //后台产品添加
        //===============================================商品分类================================================
        Route::post('/shop/goods/class/save', ['uses' => 'AdminGoodsClassController@save']);   //菜单界面显示
        Route::post('/shop/goods/class/edit', ['uses' => 'AdminGoodsClassController@edit']);   //菜单界面显示
        Route::post('/shop/goods/class/del', ['uses' => 'AdminGoodsClassController@del']);   //菜单界面显示
    });
});